import request from '@/utils/request'

/** *
 * 角色列表
 */
function roleList() {
  return request({
    url: '/sapi/sys/role/list',
    method: 'post'
  })
}

/** *
 * 添加角色
 * @param data
 */
function addRole(data) {
  return request({
    url: '/sapi/sys/role/add',
    method: 'post',
    data: data
  })
}

/** **
 * 修改角色
 * @param token
 */
function editRole(data) {
  return request({
    url: '/sapi/sys/role/edit',
    method: 'post',
    data: data
  })
}

/** *
 * 删除角色
 * @param id
 */
function deleteRole(id) {
  const postData = {}
  postData.id = id
  return request({
    url: '/sapi/sys/role/delete',
    method: 'post',
    data: postData
  })
}

export default {
  roleList,
  addRole,
  editRole,
  deleteRole
}
